package com.example.restaurant.dao;

import com.example.restaurant.model.Store;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 门店表 Mapper 接口
 * </p>
 *
 * @author x
 * @since 2022-09-29
 */
public interface StoreMapper extends BaseMapper<Store> {
    @Select("SELECT s.id,s.status,s.location,s.telephone,s.store_name,s.store_type FROM `user` u JOIN user_store us ON u.id=us.user_id JOIN store s ON s.id=us.store_id WHERE u.id=#{uid}")
    List<Store> getStore(@Param("uid") int userId);

}
